<!DOCTYPE html>
<html>
<head>
    {include file="public/header" /}
</head>
<body>
<div class="layui-form layuimini-form layui-form-pane" >
    <div class="layui-form-item">
        <input type="hidden" name="id" value="{$info.id}">
        <label class="layui-form-label required">提交人名称</label>
        <div class="layui-input-inline" style="width: 85%" onclick="checkMemberInfo('{$info.member_code}')">
            <input type="text" value="{$info.name}" style="cursor: pointer" readonly autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">提交人手机号</label>
        <div class="layui-input-inline" style="width: 85%">
            <input type="number" value="{$info.mobile}" readonly autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">照片</label>
        <div class="" style="display: flex">
            {volist name='info.picurl' id='v'}
            <div class="layui-upload-list" style="margin-top: 5px;">
                <img class="layui-upload-img headImage" style="height: 100px;" src="/upload/{$v}">
            </div>
            {/volist}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">问题</label>
        <div class="layui-input-inline" style="width: 85%">
            <input type="text" value="{$info.context}" readonly autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">备注</label>
        <div class="layui-input-inline" style="width: 85%">
            <input type="text" name="note" value="{$info.note}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">回复信息</label>
        <div class="layui-input-inline" style="width: 85%">
            <input type="text" name="reply_info" value="{$info.reply_info}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-radius" lay-submit lay-filter="saveBtn">保存</button>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form', 'laydate', 'tableSelect', 'layarea', 'upload'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;
        //监听提交
        form.on('submit(saveBtn)', function (data) {
            $.ajax({
                url: '/admin/PlatformData/feedback?action=reply',
                type: 'post',
                dataType: 'json',
                data: data.field,
                success: function (res) {
                    if (res.status == true) {
                        // 关闭弹出层
                        var iframeIndex = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(iframeIndex);
                        window.parent.location.reload();
                    } else {
                        layer.msg(res.msg);
                    }
                },
                error: function () {
                    layer.msg("报错了");
                }
            });
            return false;
        });
    });
    function checkMemberInfo(member_code){
        var index = layer.open({
            title: '提交人详情',
            type: 2,
            shade: 0.2,
            maxmin: true,
            shadeClose: true,
            area: ['100%', '100%'],
            content: '/admin/Member/write?code=' + member_code,
        });
        $(window).on("resize", function () {
            layer.full(index);
        });
    }
</script>
</body>
</html>